<?php
/**
 * auth_userPage.inc
 * Template: User profile page.
 * @copyright	Copyright(c) 2002-2010 Bjorn Winberg
 * @author		Bjorn Winberg <cms@anomalye.net>
 * @license		http://www.gnu.org/licenses/gpl.html GNU General Public License version 2
 * @package		AnomalyWiki
 */
?>

<h1><?php echo $this->localString('PU_TITLE');?></h1>

<div class="helpBox">
	<?php 
		echo $this->localString('PU_HELP');
		echo $this->getSafeStr($aParams['name']);
	?>
</div>

<?php
	return;
?>

































<h1><?php echo system_loadStr('AUTH_PU_TITLE');?></h1>
<?php
	if(strtolower($GLOBALS['_T']['auth']['userArray']['nameDisplay']) === strtolower($_SESSION['modules']['auth']['userArray']['nameDisplay'])){
		echo system_menuBuild('SYSTEM_MENU_USER', array(), 'subMenu');	
	}
	
?>

<div class="helpBox">
	<?php echo system_loadStr('AUTH_PU_HELP',  array($userName));?>
</div>

<div class="section">
	<div class="sectionHeader"><?php echo system_loadStr('AUTH_PU_INFO', array($userName));?></div>
	<?php
		if(isset($GLOBALS['_T']['auth']['userArray']['logoFileUrl'])){
			echo '<div class="authUserPageAvatar"><img alt="" src="' . $GLOBALS['_T']['auth']['userArray']['logoFileUrl'] . '" width="' . $GLOBALS['_S']['auth']['AVATAR_WIDTH'] . '" height="' . $GLOBALS['_S']['auth']['AVATAR_HEIGHT'] . '" /></div>';
		}
		echo '<div class="sectionRow1"><div class="authUserPageColInfoDesc">'. system_loadStr('AUTH_PU_JOINED') . '</div><div class="authUserPageColInfoValue">' . $creationTime . '</div></div>';
		echo '<div class="sectionRow2"><div class="authUserPageColInfoDesc">'. system_loadStr('AUTH_PU_LAST') . '</div><div class="authUserPageColInfoValue">' . $lastLogin . '</div></div>';
		if(system_requireAuthorization('AUTH/ADMIN_')){
			echo '<div class="authUserPagePermission">[<a href="index.php?p=authadmin&amp;a=edituser&amp;name=' . $GLOBALS['_T']['auth']['userArray']['nameDisplay'] . '">' . system_loadStr('AUTH_PU_ADMIN') . '</a>]</div>';
		}
	?>
	<div style="clear:both;"></div>
</div>

<div class="section">
	<div class="sectionHeader"><?php echo system_loadStr('AUTH_PU_PROFILE');?></div>
	<?php
		$customInfoBits = explode(',', system_loadStr('AUTH_EU_CUSTOMUSERINFO'));
		$isEmpty = true;
		foreach($customInfoBits as $count => $info){
			$fieldName = 'custom' . $count;
			if(isset($GLOBALS['_T']['auth']['userArray']['customInfo'][$count]) && $GLOBALS['_T']['auth']['userArray']['customInfo'][$count] != ''){
				$isEmpty = false;
				$style = $count % 2 == 0? 'sectionRow1': 'sectionRow2';
				echo '<div class="' . $style . '"><div class="authUserPageColCustomDesc">' . system_getSafeStr($info) . '</div><div class="authUserPageColCustomValue">' . system_getSafeStr($GLOBALS['_T']['auth']['userArray']['customInfo'][$count]) . '</div></div>';
			}
		}
		if($isEmpty){
			echo system_loadStr('AUTH_PU_NOPROFILE');
		}
	?>
	<?php 
		if(strtolower($GLOBALS['_T']['auth']['userArray']['nameDisplay']) === strtolower($_SESSION['modules']['auth']['userArray']['nameDisplay'])){
			echo '<div class="authUserPageEdit">[<a href="index.php?p=auth&amp;a=updateForm">' . system_loadStr('AUTH_PU_EDIT') . '</a>]</div>';
		}
	?>
</div>
